package com.kanq.controller;

import com.kanq.pojo.entity.KanqAiFileChunk;
import com.kanq.service.KanqAiFileChunkService;
import com.kanq.tool.R;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/fileChunk")
@Slf4j
public class FileChunkController {

    @Resource
    private KanqAiFileChunkService kanqAiFileChunkService;

    /**
     * 获取分段数据
     *
     * @return
     */
    @GetMapping("/getSegDataPage")
    public R getSegDataPage(@RequestParam long fileId) {
        List<KanqAiFileChunk> page = kanqAiFileChunkService.getSegDataPage(fileId);
        return R.data(page);
    }
}
